
## 计算1-5的和(1+2+3+4+5)
# range:适合固定次数
sum0 = 0
for i in range(1,6):
    sum0 = sum0+i
print(sum0)


n = 1
sum0 = 0 # 累加器
while n<=5:
    sum0 = sum0+n
    n = n+1
print(sum0)


# 输出1到无穷大
n = 1
while True:
    print(n)
    n = n+1

# 猜年龄：用while实现猜无限次



